package examples
{
	import com.wskeee.ec.components.Button;
	import com.wskeee.ec.components.Label;
	import com.wskeee.ec.containers.Container;
	import com.wskeee.ec.containers.HBox;
	import com.wskeee.ec.containers.VBox;
	import com.wskeee.ec.core.EGlobal;
	
	import flash.events.MouseEvent;

	public class IdeSkinExample
	{
		public static function createIDESkin():Container
		{
			var mainBox:VBox = new VBox();
			var head:Label = new Label();
			head.text = "Component Skin";
			mainBox.verticalGap = 20;
			mainBox.paddingTop = mainBox.paddingBottom = mainBox.paddingLeft = mainBox.paddingRight = 5;
			mainBox.addChild(head);
			
			var contentBox:HBox = new HBox();
			
			var button:Button = new Button();
			button.label = "IDE皮肤";
			button.addEventListener(MouseEvent.CLICK,function(evt:MouseEvent):void
			{
				EGlobal.resourceManager.loadSkin([{name:"ecskin",url:"../libs/ecskin.swf"}],function():void
				{
					EGlobal.useIDESkin = true;
				});
			});
			contentBox.addChild(button);
			
			button = new Button();
			button.label = "默认皮肤";
			button.addEventListener(MouseEvent.CLICK,function(evt:MouseEvent):void
			{
				EGlobal.useIDESkin = false;
			});
			contentBox.addChild(button);
			
			mainBox.addChild(contentBox);
			return mainBox;
		}
	}
}